package com.jy.rhin.valid;


import com.jy.framework.base.utils.DateUtil;
import com.jy.rhin.infra.cda.XValid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.Objects;
/**
 * @Author 姚俊
 * @Date 2023/2/28 17:04
 * @Description 时间校验器
 */
@Component
@Slf4j
public class DT14Valid extends AbsValid{

    static String format = "yyyyMMddHHmmss";

    @Override
    public String validate(XValid xValid, String value) {
        if(Objects.isNull(DateUtil.getDateByString(format, value))){
            return "不符合格式-" + format;
        }else{
            return "";
        }
    }
}
